package day20180129.designMode.eight_AbstratFactory;

/**
 * Created by 14394 on 2018/1/29.
 */
public class Test {
    public static void main(String[] args) {
//        if (args.length != 1){
//            System.out.println("Usage: java main class.name.of.ConcrteFactory");
//            System.out.println("Example 1:java Main listfactory.ListFactory");
//            System.out.println("Example 2: java Main tablefactory.Tableactory");
//            System.exit(0);
//        }

        Factory factory = Factory.getFactory("day20180129.designMode.eight_AbstratFactory.TableFactory");
        Link peple = factory.createLink("人民日报","http://www.people.com.cn/");
        Link gmw = factory.createLink("光明日报","http://www.gmw.com/");
        Link us_yahoo = factory.createLink("Yahoo!","http://www.yahoo.com/");
        Link jp_yahoo = factory.createLink("Yahoo!Japan","http://www.people.co.jp/");
        Link google = factory.createLink("Google","http://www.google.com/");

        Tray trayNews = factory.createTray("日报");
        trayNews.add(peple);
        trayNews.add(gmw);
        Tray trayYahoo = factory.createTray("Yahoo!");
        trayYahoo.add(jp_yahoo);
        trayYahoo.add(us_yahoo);
        Tray traysearch = factory.createTray("搜索引擎");
        traysearch.add(google);
        trayNews.add(google);
        Page page = factory.createPage("LinkPage","陈开海");
        page.add(trayNews);
        page.add(traysearch);
        page.output();


    }
}
